package com.hducms.cms.entity.main;

import static com.hducms.cms.Constants.RES_PATH;
import static com.hducms.cms.Constants.TPL_BASE;
import static com.hducms.cms.Constants.UPLOAD_PATH;
import static com.hducms.cms.Constants.LIBRARY_PATH;
import static com.hducms.common.web.Constants.DEFAULT;

import java.util.Collection;

import org.apache.commons.lang.StringUtils;


public class CmsSite {
	public static String PROP_INDEX_TO_ROOT = "indexToRoot";
	public static String PROP_DOMAIN = "domain";
	public static String PROP_PROTOCOL = "protocol";
	public static String PROP_LOCALE_ADMIN = "localeAdmin";
	public static String PROP_DOMAIN_REDIRECT = "domainRedirect";
	public static String PROP_UPLOAD_FTP = "uploadFtp";
	public static String PROP_RESYCLE_ON = "resycleOn";
	public static String PROP_TPL_SOLUTION = "tplSolution";
	public static String PROP_STATIC_SUFFIX = "staticSuffix";
	public static String PROP_CONFIG = "config";
	public static String PROP_STATIC_INDEX = "staticIndex";
	public static String PROP_DYNAMIC_SUFFIX = "dynamicSuffix";
	public static String PROP_FINAL_STEP = "finalStep";
	public static String PROP_SHORT_NAME = "shortName";
	public static String PROP_STATIC_DIR = "staticDir";
	public static String PROP_DOMAIN_ALIAS = "domainAlias";
	public static String PROP_PATH = "path";
	public static String PROP_AFTER_CHECK = "afterCheck";
	public static String PROP_LOCALE_FRONT = "localeFront";
	public static String PROP_NAME = "name";
	public static String PROP_ID = "id";
	public static String PROP_RELATIVE_PATH = "relativePath";

	 /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.site_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Integer siteId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.config_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Integer configId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.ftp_upload_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Integer ftpUploadId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.domain
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String domain;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.site_path
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String sitePath;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.site_name
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String siteName;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.short_name
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String shortName;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.protocol
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String protocol;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.dynamic_suffix
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String dynamicSuffix;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.static_suffix
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String staticSuffix;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.static_dir
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String staticDir;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.is_index_to_root
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Boolean isIndexToRoot;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.is_static_index
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Boolean isStaticIndex;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.locale_admin
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String localeAdmin;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.locale_front
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String localeFront;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.tpl_solution
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String tplSolution;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.final_step
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Byte finalStep;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.after_check
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Byte afterCheck;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.is_relative_path
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Boolean isRelativePath;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.is_recycle_on
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Boolean isRecycleOn;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.domain_alias
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String domainAlias;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.domain_redirect
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private String domainRedirect;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column jc_site.is_master
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    private Boolean isMaster;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.site_id
     *
     * @return the value of jc_site.site_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Integer getSiteId() {
        return siteId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.site_id
     *
     * @param siteId the value for jc_site.site_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setSiteId(Integer siteId) {
        this.siteId = siteId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.config_id
     *
     * @return the value of jc_site.config_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Integer getConfigId() {
        return configId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.config_id
     *
     * @param configId the value for jc_site.config_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setConfigId(Integer configId) {
        this.configId = configId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.ftp_upload_id
     *
     * @return the value of jc_site.ftp_upload_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Integer getFtpUploadId() {
        return ftpUploadId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.ftp_upload_id
     *
     * @param ftpUploadId the value for jc_site.ftp_upload_id
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setFtpUploadId(Integer ftpUploadId) {
        this.ftpUploadId = ftpUploadId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.domain
     *
     * @return the value of jc_site.domain
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getDomain() {
        return domain;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.domain
     *
     * @param domain the value for jc_site.domain
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setDomain(String domain) {
        this.domain = domain == null ? null : domain.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.site_path
     *
     * @return the value of jc_site.site_path
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getSitePath() {
        return sitePath;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.site_path
     *
     * @param sitePath the value for jc_site.site_path
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setSitePath(String sitePath) {
        this.sitePath = sitePath == null ? null : sitePath.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.site_name
     *
     * @return the value of jc_site.site_name
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getSiteName() {
        return siteName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.site_name
     *
     * @param siteName the value for jc_site.site_name
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setSiteName(String siteName) {
        this.siteName = siteName == null ? null : siteName.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.short_name
     *
     * @return the value of jc_site.short_name
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getShortName() {
        return shortName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.short_name
     *
     * @param shortName the value for jc_site.short_name
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setShortName(String shortName) {
        this.shortName = shortName == null ? null : shortName.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.protocol
     *
     * @return the value of jc_site.protocol
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getProtocol() {
        return protocol;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.protocol
     *
     * @param protocol the value for jc_site.protocol
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setProtocol(String protocol) {
        this.protocol = protocol == null ? null : protocol.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.dynamic_suffix
     *
     * @return the value of jc_site.dynamic_suffix
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getDynamicSuffix() {
        return dynamicSuffix;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.dynamic_suffix
     *
     * @param dynamicSuffix the value for jc_site.dynamic_suffix
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setDynamicSuffix(String dynamicSuffix) {
        this.dynamicSuffix = dynamicSuffix == null ? null : dynamicSuffix.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.static_suffix
     *
     * @return the value of jc_site.static_suffix
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getStaticSuffix() {
        return staticSuffix;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.static_suffix
     *
     * @param staticSuffix the value for jc_site.static_suffix
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setStaticSuffix(String staticSuffix) {
        this.staticSuffix = staticSuffix == null ? null : staticSuffix.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.static_dir
     *
     * @return the value of jc_site.static_dir
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getStaticDir() {
        return staticDir;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.static_dir
     *
     * @param staticDir the value for jc_site.static_dir
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setStaticDir(String staticDir) {
        this.staticDir = staticDir == null ? null : staticDir.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.is_index_to_root
     *
     * @return the value of jc_site.is_index_to_root
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Boolean getIsIndexToRoot() {
        return isIndexToRoot;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.is_index_to_root
     *
     * @param isIndexToRoot the value for jc_site.is_index_to_root
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setIsIndexToRoot(Boolean isIndexToRoot) {
        this.isIndexToRoot = isIndexToRoot;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.is_static_index
     *
     * @return the value of jc_site.is_static_index
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Boolean getIsStaticIndex() {
        return isStaticIndex;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.is_static_index
     *
     * @param isStaticIndex the value for jc_site.is_static_index
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setIsStaticIndex(Boolean isStaticIndex) {
        this.isStaticIndex = isStaticIndex;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.locale_admin
     *
     * @return the value of jc_site.locale_admin
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getLocaleAdmin() {
        return localeAdmin;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.locale_admin
     *
     * @param localeAdmin the value for jc_site.locale_admin
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setLocaleAdmin(String localeAdmin) {
        this.localeAdmin = localeAdmin == null ? null : localeAdmin.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.locale_front
     *
     * @return the value of jc_site.locale_front
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getLocaleFront() {
        return localeFront;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.locale_front
     *
     * @param localeFront the value for jc_site.locale_front
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setLocaleFront(String localeFront) {
        this.localeFront = localeFront == null ? null : localeFront.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.tpl_solution
     *
     * @return the value of jc_site.tpl_solution
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getTplSolution() {
        return tplSolution;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.tpl_solution
     *
     * @param tplSolution the value for jc_site.tpl_solution
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setTplSolution(String tplSolution) {
        this.tplSolution = tplSolution == null ? null : tplSolution.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.final_step
     *
     * @return the value of jc_site.final_step
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Byte getFinalStep() {
        return finalStep;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.final_step
     *
     * @param finalStep the value for jc_site.final_step
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setFinalStep(Byte finalStep) {
        this.finalStep = finalStep;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.after_check
     *
     * @return the value of jc_site.after_check
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Byte getAfterCheck() {
        return afterCheck;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.after_check
     *
     * @param afterCheck the value for jc_site.after_check
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setAfterCheck(Byte afterCheck) {
        this.afterCheck = afterCheck;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.is_relative_path
     *
     * @return the value of jc_site.is_relative_path
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Boolean getIsRelativePath() {
        return isRelativePath;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.is_relative_path
     *
     * @param isRelativePath the value for jc_site.is_relative_path
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setIsRelativePath(Boolean isRelativePath) {
        this.isRelativePath = isRelativePath;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.is_recycle_on
     *
     * @return the value of jc_site.is_recycle_on
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Boolean getIsRecycleOn() {
        return isRecycleOn;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.is_recycle_on
     *
     * @param isRecycleOn the value for jc_site.is_recycle_on
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setIsRecycleOn(Boolean isRecycleOn) {
        this.isRecycleOn = isRecycleOn;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.domain_alias
     *
     * @return the value of jc_site.domain_alias
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getDomainAlias() {
        return domainAlias;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.domain_alias
     *
     * @param domainAlias the value for jc_site.domain_alias
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setDomainAlias(String domainAlias) {
        this.domainAlias = domainAlias == null ? null : domainAlias.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.domain_redirect
     *
     * @return the value of jc_site.domain_redirect
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public String getDomainRedirect() {
        return domainRedirect;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.domain_redirect
     *
     * @param domainRedirect the value for jc_site.domain_redirect
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setDomainRedirect(String domainRedirect) {
        this.domainRedirect = domainRedirect == null ? null : domainRedirect.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column jc_site.is_master
     *
     * @return the value of jc_site.is_master
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public Boolean getIsMaster() {
        return isMaster;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column jc_site.is_master
     *
     * @param isMaster the value for jc_site.is_master
     *
     * @mbggenerated Wed Mar 05 18:56:30 CST 2014
     */
    public void setIsMaster(Boolean isMaster) {
        this.isMaster = isMaster;
    }
    
//	private com.hducms.cms.entity.main.CmsSiteCompany siteCompany;
//
//	// many to one
//	private com.hducms.core.entity.Ftp uploadFtp;
//	private com.hducms.cms.entity.main.CmsConfig config;
//
//	// collections
//	private java.util.Map<java.lang.String, java.lang.String> attr;
//	private java.util.Map<java.lang.String, java.lang.String> txt;
//	private java.util.Map<java.lang.String, java.lang.String> cfg;

    
    
	/**
	 * 获得站点url
	 * 
	 * @return
	 */
//	public String getUrl() {
//		if (getIsStaticIndex()) {
//			return getUrlStatic();
//		} else {
//			return getUrlDynamic();
//		}
//	}

	/**
	 * 获得完整路径。在给其他网站提供客户端包含时也可以使用。
	 * 
	 * @return
	 */
//	public String getUrlWhole() {
//		if (getIsStaticIndex()) {
//			return getUrlBuffer(false, true, false).append("/").toString();
//		} else {
//			return getUrlBuffer(true, true, false).append("/").toString();
//		}
//	}
//
//	public String getUrlDynamic() {
//		return getUrlBuffer(true, null, false).append("/").toString();
//	}
//
//	public String getUrlStatic() {
//		return getUrlBuffer(false, null, true).append("/").toString();
//	}

//	public StringBuilder getUrlBuffer(boolean dynamic, Boolean whole,
//			boolean forIndex) {
//		boolean relative = whole != null ? !whole : getIsRelativePath();
//		String ctx = getContextPath();
//		StringBuilder url = new StringBuilder();
//		if (!relative) {
//			url.append(getProtocol()).append(getDomain());
//			if (getPort() != null) {
//				url.append(":").append(getPort());
//			}
//		}
//		if (!StringUtils.isBlank(ctx)) {
//			url.append(ctx);
//		}
//		if (dynamic) {
//			String servlet = getServletPoint();
//			if (!StringUtils.isBlank(servlet)) {
//				url.append(servlet);
//			}
//		} else {
//			if (!forIndex) {
//				String staticDir = getStaticDir();
//				if (!StringUtils.isBlank(staticDir)) {
//					url.append(staticDir);
//				}
//			}
//		}
//		return url;
//	}

	/**
	 * 获得模板路径。如：/WEB-INF/t/cms/www
	 * 
	 * @return
	 */
	public String getTplPath() {
		return TPL_BASE + "/" + getSitePath();
	}

	/**
	 * 获得模板方案路径。如：/WEB-INF/t/cms/www/default
	 * 
	 * @return
	 */
	public String getSolutionPath() {
		return TPL_BASE + "/" + getSitePath() + "/" + getTplSolution();
	}

	/**
	 * 获得模板资源路径。如：/r/cms/www
	 * 
	 * @return
	 */
	public String getResPath() {
		return RES_PATH + "/" + getSitePath();
	}

	/**
	 * 获得上传路径。如：/u/jeecms/path
	 * 
	 * @return
	 */
	public String getUploadPath() {
		return UPLOAD_PATH + getSitePath();
	}
	
	public String getLibraryPath() {
		return LIBRARY_PATH + getSitePath();
	}

	/**
	 * 获得上传访问前缀。
	 * 
	 * 根据配置识别上传至数据、FTP和本地
	 * 
	 * @return
	 */
//	public String getUploadBase() {
//		CmsConfig config = getConfig();
//		String ctx = config.getContextPath();
//		if (config.getUploadToDb()) {
//			if (!StringUtils.isBlank(ctx)) {
//				return ctx + config.getDbFileUri();
//			} else {
//				return config.getDbFileUri();
//			}
//		} else if (getUploadFtp() != null) {
//			return getUploadFtp().getUrl();
//		} else {
//			if (!StringUtils.isBlank(ctx)) {
//				return ctx;
//			} else {
//				return "";
//			}
//		}
//	}
//
//	public String getServletPoint() {
//		CmsConfig config = getConfig();
//		if (config != null) {
//			return config.getServletPoint();
//		} else {
//			return null;
//		}
//	}
//
//	public String getContextPath() {
//		CmsConfig config = getConfig();
//		if (config != null) {
//			return config.getContextPath();
//		} else {
//			return null;
//		}
//	}
//
//	public Integer getPort() {
//		CmsConfig config = getConfig();
//		if (config != null) {
//			return config.getPort();
//		} else {
//			return null;
//		}
//	}
//
//	public String getDefImg() {
//		CmsConfig config = getConfig();
//		if (config != null) {
//			return config.getDefImg();
//		} else {
//			return null;
//		}
//	}
//
//	public String getLoginUrl() {
//		CmsConfig config = getConfig();
//		if (config != null) {
//			return config.getLoginUrl();
//		} else {
//			return null;
//		}
//	}
//
//	public String getProcessUrl() {
//		CmsConfig config = getConfig();
//		if (config != null) {
//			return config.getProcessUrl();
//		} else {
//			return null;
//		}
//	}
//
//	public int getUsernameMinLen() {
//		return getConfig().getMemberConfig().getUsernameMinLen();
//	}
//
//	public int getPasswordMinLen() {
//		return getConfig().getMemberConfig().getPasswordMinLen();
//	}
//
//	public static Integer[] fetchIds(Collection<CmsSite> sites) {
//		if (sites == null) {
//			return null;
//		}
//		Integer[] ids = new Integer[sites.size()];
//		int i = 0;
//		for (CmsSite s : sites) {
//			ids[i++] = s.getId();
//		}
//		return ids;
//	}
//
	public void init() {
		if (StringUtils.isBlank(getProtocol())) {
			setProtocol("http://");
		}
		if (StringUtils.isBlank(getTplSolution())) {
			setTplSolution(DEFAULT);
		}
		if (getFinalStep() == null) {
			byte step = 2;
			setFinalStep(step);
		}
	}

	/* [CONSTRUCTOR MARKER BEGIN] */
	public CmsSite () {
		init();
	}
	
	/* [CONSTRUCTOR MARKER END] */

}